
	 
//下拉菜單
$(".estate_select,.rantal_select,.new_property .estate_select").hover(function(){},function(){
    $(".estate_select ul,.rantal_select ul,.new_property .estate_select ul").hide();
});
$(".estate_select,.rantal_select").click(function(){

    $(this).find("ul").slideToggle("fast");
});
$(".estate_select ul li,.rantal_select ul li").click(function(){
 $(this).parents(".estate_select,.rantal_select").find(".select_title span").text($(this).text());
});

//圖片剪切
 $(function (){
if( $(".new_property_add img").width() > $(".new_property_add img").height()){
    $(".new_property_add img").css("height","100%");
    var w = $(".new_property_add img").width();
    var wd = $(".new_property_add,.new_property_add1").width();
    $(".new_property_add img").css("margin-left",-Math.abs((w-wd)/2)) 
}else{
     $(".new_property_add img").css("width","100%");
     var h = $(".new_property_add img").height();
     var hd =  $(".new_property_add,.new_property_add1").height();
    $(".new_property_add img").css("margin-top",-Math.abs((h-hd)/2))    
}
 });

//phone_nav
$(".nav_top .phone_nav").click(function(){
	$(".nav_top ul").slideToggle();
	$(".nav_top a").click(function(){
	$(".nav_top ul").hide();
	});	
	});

//hover_img
	$(".col_img").hover(function(){
		$(this).find(".hover_img").show();
		},function(){
			$(".hover_img").hide();	
			});
			
//點擊動畫

	  
$(".scroll").click(function(event){		
					
					$('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
					
				
				});	





//prettyPhoto	
 $("area[rel^='prettyPhoto']").prettyPhoto();

$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed: 'normal', theme: 'light_square', slideshow: 30000, autoplay_slideshow: true});
$(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed: 'fast', slideshow: 10000, hideflash: true});

$(".img_ico").click(function(){
	
	$(".pp_none").show();
	});


//goto top
$(window).scroll(function(){
 $(this).scrollTop()>1? $('.go_top i').show(): $('.go_top i').hide(); 
});
function goTop(){
	$('html,body').animate({'scrollTop':0},600);
}



//nav
$(document).ready(function(){
	var $liCur = $(".nav_top ul li.cur"),
	  curP = $liCur.position().left,
	  curW = $liCur.outerWidth(true),
	  $slider = $(".curBg"),
	  $navBox = $(".nav_top");
	 $targetEle = $(".nav_top ul li a"),
	$slider.animate({
	  "left":curP,
	  "width":curW
	});
	$targetEle.mouseenter(function () {
	  var $_parent = $(this).parent(),
		_width = $_parent.outerWidth(true),
		posL = $_parent.position().left;
	  $slider.stop(true, true).animate({
		"left":posL,
		"width":_width
	  }, "fast");
	});
	$navBox.mouseleave(function (cur, wid) {
	  cur = curP;
	  wid = curW;
	  $slider.stop(true, true).animate({
		"left":cur,
		"width":wid
	  }, "fast");
	});
})


